package com.zky.action;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.zky.DAO.impl.UsersDaoImp;

import com.zky.entity.Users;

public class OnLoginAction extends UsersDaoImp {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public String verify;	
	public String username;
	public String password;
	public String ppa;
	public String getPpa() {
		return ppa;
	}
	public void setPpa(String ppa) {
		this.ppa = ppa;
	}
	public String getVerify() {
		return verify;
	}
	public void setVerify(String verify) {
		this.verify = verify;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String checkRegisterName() {
		ActionContext ctx = ActionContext.getContext();
		 String pp = (String) ctx.getSession().get("rand");
		List<Users> list = this.findAll1(username, password);
		if ( list.size()!= 0&&list!=null&&pp.equals(verify)) {	
			ppa=(String) ctx.getSession().put("username", username);
			return "success";
		} else {
			return "false";
		}
	}
	
	
	

}
